<div class="btn-group pull-right" style="margin-left: 10px;margin-right:2px;margin-bottom: 20px;">
  <button class="btn btn-primary" type="button" id="btn_detailedSearch" (click)="btn_detailedSearch()">高级查询</button>
  <button class="btn btn-primary" type="button" id="btn_select" (click)="addMaintain()" >登记维护</button>
  <button class="btn btn-primary" type="button" id="btn_typedel" (click)="delInfo()">批量结束维护</button>
</div>
<div class="col-md-12">
  <nz-table #nzTable
            [nzAjaxData]="_dataSet"
            [nzShowSizeChanger]="true"
            [nzTotal]="_total"
            [(nzPageIndex)]="_current"
            (nzPageIndexChange)="refreshData()"
            [(nzPageSize)]="_pageSize"
            (nzPageSizeChange)="refreshData(true)"
            (nzDataChange)="_displayDataChange($event)"
            [nzScroll]="{ y: 500 }">
    <ng-template #nzFixedHeader>
      <thead nz-thead>
      <tr class="tableTitle">
        <th nz-th [nzCheckbox]="true" [nzWidth]="'5%'">
          <label *ngIf="allCheckbox" nz-checkbox [(ngModel)]="_allChecked" (ngModelChange)="_checkAll($event)">
          </label>
        </th>
        <th nz-th [nzWidth]="'20%'" align="center">
          <span>维护类型</span>
        </th>
        <th nz-th [nzWidth]="'20%'" align="center">
          <span>开始时间</span>
        </th>
        <th nz-th [nzWidth]="'20%'" align="center">
          <span>结束时间</span>
        </th>
        <th nz-th [nzWidth]="'10%'" align="center">
          <span>状态</span>
        </th>
        <th nz-th [nzWidth]="'25%'" align="center">
          <span>操作</span>
        </th>
      </tr>
      </thead>
    </ng-template>
    <tbody nz-tbody>
    <tr nz-tbody-tr *ngFor="let data of nzTable.data">
      <td nz-td [nzCheckbox]="true">
        <label *ngIf="data.status === 0" nz-checkbox [(ngModel)]="data.checked" (ngModelChange)="_refreshStatus($event,data.oid)">
        </label>
      </td>
      <td nz-td>{{data.maintainTypeObj.name}}</td>
      <td nz-td>{{data.starttime.substring(0,16)}}</td>
      <td nz-td>{{data.endtime.substring(0,16)}}</td>
      <td nz-td>{{data.statusname}}</td>
      <td nz-td>

        <a (click)="viewrecord(data.oid)">详情</a>
        <a *ngIf="data.status === 0" (click)="updaterecord(data.oid)">修改</a>
        <a *ngIf="data.status === 0" (click)="endrecord(data.oid)">结束维护</a>

      </td>
    </tr>
    </tbody>
  </nz-table>
</div>

<!-- 维护记录开窗modal -->
<nz-modal id="maintainModal"  [nzVisible]="maintainIsVisible" [nzTitle]="'用车维护'" [nzContent]="maintainModalContent"
          [nzFooter]="false" (nzOnCancel)="maintainHandleCancel($event)" >
  <ng-template #maintainModalContent>
    <app-maintain-model></app-maintain-model>
  </ng-template>
</nz-modal>
